<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Get copy of formatterʼs calendar object</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="intldateformatter.gettimezoneid.html">IntlDateFormatter::getTimeZoneId</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intldateformatter.gettimezone.html">IntlDateFormatter::getTimeZone</a></div>
 <div class="up"><a href="class.intldateformatter.html">IntlDateFormatter</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="intldateformatter.getcalendarobject" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">IntlDateFormatter::getCalendarObject</h1>
  <h1 class="refname">datefmt_get_calendar_object</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.5.0, PECL intl &gt;= 3.0.0)</p><p class="refpurpose"><span class="refname">IntlDateFormatter::getCalendarObject</span> -- <span class="refname">datefmt_get_calendar_object</span> &mdash; <span class="dc-title">Get copy of formatterʼs calendar object</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-intldateformatter.getcalendarobject-description">
  <h3 class="title">说明</h3>
  <p class="para">
   面向对象风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span>
   <span class="type"><a href="class.intlcalendar.html" class="type IntlCalendar">IntlCalendar</a></span> 
   <span class="methodname"><strong>IntlDateFormatter::getCalendarObject</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   过程化风格
  </p>
  <div class="methodsynopsis dc-description">
   <span class="type"><a href="class.intlcalendar.html" class="type IntlCalendar">IntlCalendar</a></span> 
   <span class="methodname"><strong>datefmt_get_calendar_object</strong></span>
    ( <span class="methodparam">void</span>
   )</div>

  
  <p class="para rdfs-comment">
   Obtain a copy of the calendar object used internally by this formatter. This
   calendar will have a type (as in gregorian, japanese, buddhist, roc, persian,
   islamic, etc.) and a timezone that match the type and timezone used by the
   formatter. The date/time of the object is unspecified.
  </p>
  
 </div>

 
 <div class="refsect1 parameters" id="refsect1-intldateformatter.getcalendarobject-parameters">
  <h3 class="title">参数</h3>
  <p class="para">此函数没有参数。</p>
 </div>

 
 <div class="refsect1 returnvalues" id="refsect1-intldateformatter.getcalendarobject-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   A copy of the internal calendar object used by this formatter.
  </p>
 </div>

 
 
 <div class="refsect1 examples" id="refsect1-intldateformatter.getcalendarobject-examples">
  <h3 class="title">范例</h3>
  <p class="para">
   <div class="example" id="example-2582">
    <p><strong>Example #1 <span class="function"><strong>IntlDateFormatter::getCalendarObject()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$formatter&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">create</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"fr_FR@calendar=islamic"</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">NULL</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">NULL</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"GMT-01:00"</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">IntlDateFormatter</span><span style="color: #007700">::</span><span style="color: #0000BB">TRADITIONAL<br /></span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$cal&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$formatter</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCalendarObject</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getType</span><span style="color: #007700">(),<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getTimeZone</span><span style="color: #007700">(),<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cal</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getLocale</span><span style="color: #007700">(</span><span style="color: #0000BB">Locale</span><span style="color: #007700">::</span><span style="color: #0000BB">VALID_LOCALE</span><span style="color: #007700">)<br />);</span>
</span>
</code></div>
    </div>

    <div class="example-contents"><p>以上例程会输出：</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
string(7) &quot;islamic&quot;
object(IntlTimeZone)#3 (4) {
  [&quot;valid&quot;]=&gt;
  bool(true)
  [&quot;id&quot;]=&gt;
  string(9) &quot;GMT-01:00&quot;
  [&quot;rawOffset&quot;]=&gt;
  int(-3600000)
  [&quot;currentOffset&quot;]=&gt;
  int(-3600000)
}
string(5) &quot;fr_FR&quot;
</pre></div>
    </div>
   </div>
  </p>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-intldateformatter.getcalendarobject-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="intldateformatter.getcalendar.html" class="function" rel="rdfs-seeAlso">IntlDateFormatter::getCalendar()</a> - Get the calendar type used for the IntlDateFormatter</span></li>
    <li class="member"><span class="function"><a href="intldateformatter.setcalendar.html" class="function" rel="rdfs-seeAlso">IntlDateFormatter::setCalendar()</a> - Sets the calendar type used by the formatter</span></li>
    <li class="member"><a href="class.intlcalendar.html" class="classname">IntlCalendar</a></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="intldateformatter.gettimezoneid.html">IntlDateFormatter::getTimeZoneId</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="intldateformatter.gettimezone.html">IntlDateFormatter::getTimeZone</a></div>
 <div class="up"><a href="class.intldateformatter.html">IntlDateFormatter</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
